class Solution {
public:
    int minimumChairs(string s) {

        int cnt1 = 0, cnt2 = 0;

        int ans = 0;
        for (int i = 0; i < s.size(); i++)
        {
            if (s[i] == 'E')
                cnt1++;
            else
                cnt2++;

            ans = max(ans, cnt1 - cnt2);

        }
        return ans;
    }
};